<%@ Page Language="vb" AutoEventWireup="true" CodeBehind="ContactsPage.aspx.vb" Inherits="C4F.DevKit.Contacts.Samples.Web.ContactsPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
	<link rel="Stylesheet" type="text/css" href="style.css"/>    
	<title>Untitled Page</title>    
</head>
<body>
	<form id="form1" runat="server">    
		<table>
		<tr valign="top">                           
			<td>
			<asp:GridView ID="grdContacts" runat="server" AutoGenerateColumns="False" 
				DataSourceID="sqlContacts" CellPadding="10" CaptionAlign="Left" 
				CssClass="Contacts" Caption="Contacts" 
				onselectedindexchanged="grdContacts_SelectedIndexChanged" DataKeyNames="ContactID">
				<columns>
					<asp:commandfield ShowSelectButton="True"></asp:commandfield>
					<asp:boundfield DataField="ContactID" HeaderText="ContactID" 
					SortExpression="ContactID" Visible="False"></asp:boundfield>
					<asp:boundfield DataField="FirstName" HeaderText="First Name" 
					SortExpression="FirstName"></asp:boundfield>
					<asp:boundfield DataField="LastName" HeaderText="Last Name" 
					SortExpression="LastName"></asp:boundfield>
					<asp:boundfield DataField="MiddleName" HeaderText="Middle Name" 
					SortExpression="MiddleName"></asp:boundfield>
					<asp:boundfield DataField="Notes" HeaderText="Notes" SortExpression="Notes"></asp:boundfield>
					<asp:boundfield DataField="BusinessPhone" HeaderText="Work Phone" 
					SortExpression="BusinessPhone"></asp:boundfield>
					<asp:boundfield DataField="BusinessEmail" HeaderText="Work Email" 
					SortExpression="BusinessEmail"></asp:boundfield>
				</columns>
			</asp:GridView>                    
			<asp:SqlDataSource ID="sqlContacts" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnection %>" 
			SelectCommand="SELECT * FROM [SimpleContact]"></asp:SqlDataSource>
			</td>          

			<td>            

			<div  style="padding-bottom:10px; width: 225px;">
			</div>

			<div>
				<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
				Caption="Business" CaptionAlign="Left" DataSourceID="sqlFilteredContact" Height="50px" 
				Width="100%">
					<fieldheaderstyle backcolor="#CCFFCC" />
					<fields>
						<asp:boundfield DataField="BusinessStreet" HeaderText="Street" 
						SortExpression="BusinessStreet"></asp:boundfield>
						<asp:boundfield DataField="BusinessCity" HeaderText="City" 
						SortExpression="BusinessCity"></asp:boundfield>
						<asp:boundfield DataField="BusinessState" HeaderText="State" 
						SortExpression="BusinessState"></asp:boundfield>
						<asp:boundfield DataField="BusinessZip" HeaderText="Zip" 
						SortExpression="BusinessZip"></asp:boundfield>
						<asp:boundfield DataField="BusinessCountry" HeaderText="Country" 
						SortExpression="BusinessCountry"></asp:boundfield>
						<asp:boundfield DataField="BusinessEmail" HeaderText="Email" 
						SortExpression="BusinessEmail"></asp:boundfield>
						<asp:boundfield DataField="BusinessPhone" HeaderText="Phone" 
						SortExpression="BusinessPhone"></asp:boundfield>
						<asp:boundfield DataField="BusinessFax" HeaderText="Fax" 
						SortExpression="BusinessFax"></asp:boundfield>
					</fields>
				</asp:DetailsView>
				<asp:DetailsView ID="DetailsView2" runat="server" AutoGenerateRows="False" 
				Caption="Home" CaptionAlign="Left" DataSourceID="sqlFilteredContact" Height="50px" 
				Width="100%">
					<fieldheaderstyle backcolor="#CCFFCC" />
					<fields>
						<asp:boundfield DataField="HomeStreet" HeaderText="Street" 
						SortExpression="HomeStreet"></asp:boundfield>
						<asp:boundfield DataField="HomeCity" HeaderText="City" 
						SortExpression="HomeCity"></asp:boundfield>
						<asp:boundfield DataField="HomeState" HeaderText="State" 
						SortExpression="HomeState"></asp:boundfield>
						<asp:boundfield DataField="HomeZip" HeaderText="Zip" SortExpression="HomeZip"></asp:boundfield>
						<asp:boundfield DataField="HomeCountry" HeaderText="Country" 
						SortExpression="HomeCountry"></asp:boundfield>
						<asp:boundfield DataField="HomePhone" HeaderText="Phone" 
						SortExpression="HomePhone"></asp:boundfield>
						<asp:boundfield DataField="PersonalMobile" HeaderText="Mobile" 
						SortExpression="PersonalMobile"></asp:boundfield>
						<asp:boundfield DataField="HomeFax" HeaderText="Fax" SortExpression="HomeFax"></asp:boundfield>
						<asp:boundfield DataField="PersonalEmail1" HeaderText="Email1" 
						SortExpression="PersonalEmail1">
						</asp:boundfield>
						<asp:boundfield DataField="PersonalEmail2" HeaderText="Email2" 
						SortExpression="PersonalEmail2">
						</asp:boundfield>
					</fields>
				</asp:DetailsView>
				<asp:DetailsView ID="DetailsView3" runat="server" AutoGenerateRows="False" 
				Caption="Position" CaptionAlign="Left" DataSourceID="sqlFilteredContact" Height="50px" 
				Width="100%">
					<fieldheaderstyle backcolor="#CCFFCC" />
					<fields>
						<asp:boundfield DataField="Company" HeaderText="Company" 
						SortExpression="Company"></asp:boundfield>
						<asp:boundfield DataField="Department" HeaderText="Department" 
						SortExpression="Department"></asp:boundfield>
						<asp:boundfield DataField="JobTitle" HeaderText="Job Title" 
						SortExpression="JobTitle"></asp:boundfield>
						<asp:boundfield DataField="Profession" HeaderText="Profession" 
						SortExpression="Profession"></asp:boundfield>
						<asp:boundfield DataField="Role" HeaderText="Role" SortExpression="Role"></asp:boundfield>
						<asp:boundfield DataField="Organization" HeaderText="Organization" 
						SortExpression="Organization"></asp:boundfield>
						<asp:boundfield DataField="Office" HeaderText="Office" SortExpression="Office"></asp:boundfield>
					</fields>
				</asp:DetailsView>
				<asp:SqlDataSource ID="sqlFilteredContact" runat="server" 
				ConnectionString="<%$ ConnectionStrings:DatabaseConnection %>" 
				SelectCommand="SELECT * FROM [SimpleContact] WHERE ([ContactID] = @ContactID)">
					<selectparameters>
						<asp:controlparameter ControlID="grdContacts" Name="ContactID" 
						PropertyName="SelectedValue" Type="Object" />
					</selectparameters>
				</asp:SqlDataSource>
			</div>
			</td>        
		</tr>      
		</table>
	</form>
</body>
</html>
